﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FPSO.Models.TagMapping
{
    public class FieldMapperAttribute : Attribute
	{
		/// <summary>
		/// 映射名称
		/// </summary>
		public string FieldMapperName { get; private set; }
		/// <summary>
		/// 是否映射到tstamp
		/// </summary>
		public bool IsTStamp { get; private set; }
		/// <summary>
		/// 数据源类型
		/// </summary>
		public TypeCode SourceType { get; private set; }
		/// <summary>
		/// 转换系数 数据值 = 原始数据 * 转换系数
		/// </summary>
		public double Coefficient { get; private set; }

		public FieldMapperAttribute(string name)
        {
			FieldMapperName = name;
			IsTStamp = false;
			SourceType = TypeCode.Empty;
			Coefficient = 1;
        }

		public FieldMapperAttribute(string name, bool tstamp)
		{
			FieldMapperName = name;
			IsTStamp = tstamp;
			SourceType = TypeCode.Empty;
			Coefficient = 1;
		}

		public FieldMapperAttribute(string name, TypeCode sourceType, double coefficient)
		{
			FieldMapperName = name;
			IsTStamp = false;
			SourceType = sourceType;
			Coefficient = coefficient;
		}
	}
}
